home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Toolbox / OtherResInfo-MungeDeamon / OtherResInfo • Read Me < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.3 KB  |  70 lines  |  [TEXT/MPS ]

  1. OtherResInfo/MungeDeamon
  2. © 1992 Apple Computer.
  3. C.K. Haun
  4.  
  5. The Problem:
  6. You want access to another resource fork, for some reason or other.
  7. Maybe you want to count resources, find something, duplicate something,
  8. or whatever.
  9.  
  10. BUT
  11. Whenever you open someone else's resource fork, you run the following risks....
  12. 1)     If the fork was already open, YOU can never close it, because you'll
  13.     really mess up whomever needed it open (like a running app, nèh?).
  14. 2)     The resources in that file could mess YOU up.  You may pull
  15.     the wrong dialog, icon, or (horrors) CODE resource out of the wrong
  16.     fork.  It's really nasty when you think you're executing your code 
  17.     and you're not, because the Segement Loader pulled CODE X out of
  18.     the other resource fork, not yours.
  19.  
  20. And there are other, subtle things that can mess up your mind when you suddenly
  21. have someone else's resource map in your chain, and you can't get rid of it.
  22.  
  23. The Solution!
  24. Under 7.0 and later, there is a nice, neat, clean, and cute solution to this
  25. problem.
  26. Have someone else to the work for you!
  27.  
  28. This sample demonstrates how to use a background-only application and
  29. AppleEvents to safely open and query another application's (or other file's)
  30. resource fork.
  31.  
  32. The MungeDeamon background-only application included in this sample is a 
  33. demonstration of how to do this.
  34.  
  35.  
  36. How It Works
  37.  
  38. Launch OtherResInfo
  39.  
  40. Select "Get Resource Info" from the "Resource Info" menu
  41.  
  42. You'll be prompted for three things
  43.    The resource type you're interested in
  44.    The file you want to get this information from (can be a running app)
  45.    Whether you want MungeDeamon to quit when it's done or not
  46.  
  47. OtherResInfo will find and launch MungeDeamon
  48.  
  49. OtherResInfo will send an AppleEvent to MungeDeamon asking for information
  50.     on the resource type and file you requested.
  51.  
  52. MungeDeamon will munge the information out of the file, and pack it all up
  53.     and send it back to OtherResInfo
  54.  
  55. OtherResInfo will, like, show you the info.
  56.  
  57. MungeDeamon will either stay running or quit, depending on what you told it
  58.     to do.
  59.     
  60. You have all the information you need in your foreground app WITHOUT getting
  61. a strange resource map in your file that you can't get rid of.
  62.  
  63. And this is just one of a myriad of examples of what you can do safely with
  64. a backgrounder that is harder with an 'all-in-one' app.
  65.  
  66. Backgrounders Are So Cool
  67.  
  68. C.K. Haun
  69. Apple DTS
  70. ALink: DEVSUPPORT